Skip to content

fix: skip error toast for coroutine cancellation#693

Merged
jvsena42 merged 2 commits intomasterfrom
fix/ignore-coroutine-initialization-error
Jan 21, 2026
Merged

fix: skip error toast for coroutine cancellation#693
jvsena42 merged 2 commits intomasterfrom
fix/ignore-coroutine-initialization-error

Conversation

@jvsena42
Copy link
Copy Markdown
Member

@jvsena42 jvsena42 commented Jan 21, 2026

Fixes #688
This PR skips showing the error toast when camera initialization fails due to coroutine cancellation.

Description

When navigating away from the SendRecipientScreen while the camera is initializing, a CancellationException is thrown. This is expected behavior when a coroutine scope leaves composition, but previously it would show an error toast to the user. The fix adds a check to skip the toast for CancellationException.

Preview

error-from-e2e.mp4

QA Notes

  1. Open the Send flow to display the QR scanner
  2. Quickly navigate back before the camera fully initializes
  3. Verify no error toast appears
  4. Verify the camera still works correctly when reopening the send flow

@claude

This comment has been minimized.

@jvsena42 jvsena42 self-assigned this Jan 21, 2026
@jvsena42 jvsena42 requested a review from ovitrif January 21, 2026 10:15
@jvsena42 jvsena42 enabled auto-merge January 21, 2026 10:15
@jvsena42
Copy link
Copy Markdown
Member Author

@piotr-iohk this will fix a flackines on a test flow

Copy link
Copy Markdown
Collaborator

@ovitrif ovitrif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jvsena42
Copy link
Copy Markdown
Member Author

@piotr-iohk it is still failing
OBS: the input check has a debounce of one second
https://github.com/synonymdev/bitkit-android/actions/runs/21206197567/job/61003622714?pr=693

@piotr-iohk
Copy link
Copy Markdown
Collaborator

@piotr-iohk it is still failing OBS: the input check has a debounce of one second https://github.com/synonymdev/bitkit-android/actions/runs/21206197567/job/61003622714?pr=693

Yes, looking...

@piotr-iohk
Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

@piotr-iohk piotr-iohk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jvsena42 jvsena42 merged commit 1767066 into master Jan 21, 2026
27 of 32 checks passed
@jvsena42 jvsena42 deleted the fix/ignore-coroutine-initialization-error branch January 21, 2026 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Unable to read QR" failed to initialize camera toast error occasionally appears on Manual enter address

3 participants